@inherits Microsoft.VisualStudio.Web.CodeGeneration.Templating.RazorTemplateBase
@using System.Collections.Generic
@using System.Linq
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@{
    var namespaceSet = new HashSet<string>(
        new string[]
        {
            "Microsoft.AspNetCore.Identity",
            "Microsoft.AspNetCore.Identity.EntityFrameworkCore",
            "Microsoft.EntityFrameworkCore"
        });

    if (Model.IsGenerateCustomUser)
    {
        if (Model.DbContextNamespace != Model.UserClassNamespace)
        {
            namespaceSet.Add(Model.UserClassNamespace);
        }
    }
    foreach(var name in namespaceSet.OrderBy(n => n))
    {
@:using @name;
    }
}

namespace @(Model.DbContextNamespace)
{
    public class @Model.DbContextClass : IdentityDbContext<@(Model.UserClass)>
    {
        public @(Model.DbContextClass)(DbContextOptions<@Model.DbContextClass> options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
            // Customize the ASP.NET Identity model and override the defaults if needed.
            // For example, you can rename the ASP.NET Identity table names and more.
            // Add your customizations after calling base.OnModelCreating(builder);
        }
    }
}
